package com.cskaoyan.mapper;

import com.cskaoyan.bean.Role;
import com.cskaoyan.bean.RoleExample;
import com.cskaoyan.bean.bo.AdminRoleVO;
import com.cskaoyan.bean.vo.PermissionFourthChildVO;
import com.cskaoyan.bean.vo.PermissionSecondChildVO;
import com.cskaoyan.bean.vo.PermissionThirdChildVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RoleMapper {
    long countByExample(RoleExample example);

    int deleteByExample(RoleExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Role record);

    int insertSelective(Role record);

    List<Role> selectByExample(RoleExample example);

    List<AdminRoleVO> selectRole();

    Role selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Role record, @Param("example") RoleExample example);

    int updateByExample(@Param("record") Role record, @Param("example") RoleExample example);

    int updateByPrimaryKeySelective(Role record);

    int updateByPrimaryKey(Role record);

    int updateByLatestRole(Role record);

    List<Integer> selectCategoryIds();

    PermissionSecondChildVO selectSecondChildInfo(Integer categoryId);

    List<String> selectThirdChildNames(Integer categoryId);

    PermissionThirdChildVO selectThirdChildInfo(Integer categoryThirdChildId);

    List<PermissionFourthChildVO> selectFourthChildInfo(String categoryThirdChildName);

    List<String> selectAssignedPermissions(Integer roleId);

    int deletePermissionByRoleId(Integer roleId);

    void insertRoleIdAndPermission(Integer roleId, String permission);

    String selectRoleNameById(Integer roleId);
    
}